﻿@model List<Article>
@inject NetCoreCMS.IServices.IArticle_categoryService _article_category
@{
    Layout = null;
    Sysconfig config = ViewData["config"] as Sysconfig;
    Article_category cate = ViewBag.cate as Article_category;
}
<!DOCTYPE html>
<!--HTML5 doctype-->
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
    <title>@cate.title</title>
    <link rel="stylesheet" type="text/css" href="/css/pagination.css" />
    <link rel="stylesheet" type="text/css" href="/mobile/css/style.css" />
    <script type="text/javascript" charset="utf-8" src="/mobile/js/zepto.min.js"></script>
    <script type="text/javascript" charset="utf-8" src="/mobile/js/weui.min.js"></script>
    <script type="text/javascript" charset="utf-8" src="/mobile/js/common.js"></script>
</head>

<body ontouchstart>
    <div class="page">
        <!--页面头部-->
        <div class="header">
            <a class="back" href="javascript:history.back();">
                <i class="iconfont icon-arrow-left"></i>
            </a>
            <h3>购物商城</h3>
            <div class="right">
                <a class="weui-cell_access weui-cell_link" onclick="showDialogBox('#category-box');">
                    <i class="iconfont icon-nav"></i>
                </a>
            </div>
        </div>
        <!--/页面头部-->
        <!--页面内容-->
        <div class="page__bd">
            <!--商品列表-->
            <div class="weui-panel weui-panel_access" style="margin-top:10px;">
                <div class="weui-panel__hd">@cate.title</div>
                <div class="weui-panel__bd">
                    <div class="img-list">
                        <ul>
                            <!--取得一个分页DataTable-->                            
                            @foreach(Article dr in Model)
                            {
                            <li>
                                <div class="wrap">
                                    @if (dr.is_red == 1)
                                    {
                                    <span class="number">推荐</span>
                                    }
                                    else if (dr.is_hot == 1)
                                    {
                                    <span class="number">热门</span>
                                    }
                                    <a asp-action="Show" asp-route-id="@dr.id">
                                        <img src="@dr.img_url" />
                                        <div class="note">
                                            <h2>@dr.title</h2>
                                            <p>
                                                <i class="hot">库存 @dr.stock_quantity</i>
                                                <i class="price">¥@dr.sell_price</i>元
                                            </p>
                                        </div>
                                    </a>
                                </div>
                            </li>
                            }
                        </ul>
                    </div>

                </div>
            </div>
            <!--/商品列表-->
            <!--分页页码-->
            <div class="page-list">
                @Html.Raw(ViewBag.pagelist)
            </div>
            <!--/分页页码-->
            <!--版权信息-->
            @await Html.PartialAsync("~/Areas/Web/Views/Shared/_Copyright.cshtml")
            <!--/版权信息-->
            <!--底部导航-->
            @await Html.PartialAsync("~/Areas/Web/Views/Shared/_Footer.cshtml")
            <!--/底部导航-->
        </div>
        <!--/页面内容-->
    </div>

    <!--类别容器-->
    <div id="category-box" class="dialog-wrap">
        <div class="dialog-box">
            <div class="header">
                <a class="back" href="javascript:;" onclick="closeDialogBox('#category-box');">
                    <i class="iconfont icon-arrow-left"></i>
                </a>
                <h3>栏目类别</h3>
            </div>
            <ul class="navbar">
                @{
                    var categoryList1 = _article_category.GetChildList(0, 0, 2);
                }
                @foreach (Article_category cdr1 in categoryList1)
                {
                    <li>
                        <h3><a asp-area="Web" asp-controller="Goods" asp-action="List" asp-route-id="@cdr1.id">@cdr1.title</a></h3>
                        <p>
                            @{var categoryList2 = _article_category.GetChildList(0, cdr1.id, 2);}
                            @foreach (Article_category cdr2 in categoryList2)
                            {
                                @if (cdr2.id == cate.id)
                                {
                                    <a asp-area="Web" asp-controller="Goods" asp-action="List" asp-route-id="@cdr2.id" class="selected">@cdr2.title</a>
                                }
                                else
                                {
                                    <a asp-area="Web" asp-controller="Goods" asp-action="List" asp-route-id="@cdr2.id">@cdr2.title</a>
                                }
                            }
                        </p>
                    </li>
                }
            </ul>
        </div>
    </div>
    <!--类别容器-->

</body>
</html>
